layui.define(function(exports){
  var $ = layui.$
  ,layer = layui.layer
  ,laytpl = layui.laytpl
  ,setter = layui.setter
  ,view = layui.view
  ,admin = layui.admin


// test
var i =1;
var obj={
  i:2,
  f:function(){
    console.log(this.i);
  }
}

var f2 = obj.f;

var obj2 = {
  i:3,
  f:function(ff){
    ff();
  },
  f2:function(){
    function fff(){
      console.log(this.i);
    }
    return fff;
  }
}
obj2.f(obj.f);//3
obj2.f = obj.f;
obj2.f();//
obj2.f2()();
// test

  var func={
  	openMenu:function(){
  		$('.toggleMenu').data('state',1).html('&#xe9be;');
  		$('#pgis_app').addClass('menuOpen').removeClass('menuClose');
  	},
  	closeMenu:function(){
  		$('.toggleMenu').data('state',0).html('&#xe9bf;') ;
  		$('#pgis_app').addClass('menuClose').removeClass('menuOpen');
  	}
  }
  $('.toggleMenu').click(function(){
		var state =$(this).data('state');

		// console.log(typeof(state));
		// state>0 ? $(this).data('state',0).html('&#xe9bf;') : $(this).data('state',1).html('&#xe9be;')
		if(state>0){
			func.closeMenu()
		}else{
			func.openMenu()
			
		}  
	});
  exports('pgis', {})
})